// 模块规则

// https://typescript-eslint.io/rules/
// https://www.npmjs.com/package/eslint-plugin-import
module.exports = {
    plugins: [
        "eslint-plugin-import",
        "@typescript-eslint",
    ],
    "rules": {
        // 引入弃用的模块
        "import/no-deprecated": "off",
        // 禁用ts中的module和namespace
        "@typescript-eslint/no-namespace": "error",
        // 禁用require
        "@typescript-eslint/no-require-imports": "error",
        // 禁用var file = require('');
        "@typescript-eslint/no-var-requires": "error",
        "@typescript-eslint/prefer-namespace-keyword": "error",
        // 标签reference的使用规则
        "@typescript-eslint/triple-slash-reference": ["error", { path: "always", types: "prefer-import", lib: "always" }],
        // 可以使用export default
        "import/no-default-export": "off",
        // 可以引用dev的包
        "import/no-extraneous-dependencies": ["off", { devDependencies: false }],
        "import/no-internal-modules": ["off", { allow: ["@angular/*", "zone.js/*", "rxjs/*", "ngx-color/*", "brace/*"] }],
        "import/no-unassigned-import": "off",
        "import/order": "off",
        // 禁止重复导入
        "no-duplicate-imports": "error",
    }
}
